local joy__xingwu = fk.CreateSkill {

  name = "joy__xingwu",

  tags = {  },

}



joy__xingwu:addEffect("active", {
  name = "joy__xingwu",
  anim_type = "offensive",
  card_num = 1,
  target_num = 1,
  prompt = "#joy__xingwu",
  can_use = function(self, player)
    return player:usedSkillTimes(joy__xingwu.name, Player.HistoryPhase) == 0 and not player:isKongcheng()
  end,
  card_filter = function(self, player, to_select, selected)
    return #selected == 0 and Fk:currentRoom():getCardArea(to_select) == Player.Hand and not player:prohibitDiscard(Fk:getCardById(to_select))
  end,
  target_filter = function(self, player, to_select, selected)
    return #selected == 0 and to_select ~= player.id
  end,
  on_use = function(self, room, effect)
    local player = effect.from
    local target = effect.tos[1]
    room:throwCard(effect.cards, joy__xingwu.name, player, player)
    if player.dead then return end
    player:turnOver()
    if player.dead then return end
    if #target:getCardIds("e") > 0 then
      local id = room:askForCardChosen(player, target, "e", joy__xingwu.name)
      room:throwCard({id}, joy__xingwu.name, target, player)
    end
    if target.dead then return end
    local n = target.gender == General.Male and 2 or 1
    room:damage{
      from = player,
      to = target,
      damage = n,
      skillName = joy__xingwu.name,
    }
  end,
})

return joy__xingwu